//
//  HomeTongueTypeView.m
//  Ginix
//
//  Created by 冯志强 on 2025/2/23.
//

#import "HomeTongueTypeView.h"

@interface HomeTongueTypeView()
@property (nonatomic,strong) UIView * lienView;
@property (nonatomic,strong) UILabel * nameLabel;
@end

@implementation HomeTongueTypeView

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self setSubViewLayout];
    }
    return self;
}
-(void)setSubViewLayout{
    
    [self addSubview:self.lienView];
    [_lienView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(@0);
        make.height.mas_offset(6 * FMScaleX);
    }];
    [self addSubview:self.nameLabel];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.lienView.mas_bottom).offset(10 * FMScaleX);
        make.centerX.equalTo(self.lienView);
    }];
}

-(void)setSeIndex:(NSInteger)seIndex{
    
    switch (seIndex) {
        case 0:
            self.lienView.backgroundColor = RDRGB(0xF1EBEB);
            self.nameLabel.text = @"淡白";
            break;
        case 1:
            self.lienView.backgroundColor = RDRGB(0xF9D6D4);
            self.nameLabel.text = @"淡红";
            break;
        case 2:
            self.lienView.backgroundColor = RDRGB(0xF28486);
            self.nameLabel.text = @"红";
            break;
        case 3:
            self.lienView.backgroundColor = RDRGB(0xD2381F);
            self.nameLabel.text = @"绛红";
            break;
        case 4:
            self.lienView.backgroundColor = RDRGB(0x9238CA);
            self.nameLabel.text = @"青紫";
            break;
        default:
            break;
    }
    
}

-(void)setIndex:(NSInteger)index{
    
    switch (index) {
        case 0:
            self.lienView.backgroundColor = RDRGB(0xF1EBEB);
            self.nameLabel.text = @"淡白";
            break;
        case 1:
            self.lienView.backgroundColor = RDRGB(0xF9DC9D);
            self.nameLabel.text = @"黄色";
            break;
        case 2:
            self.lienView.backgroundColor = RDRGB(0xC4C4C4);
            self.nameLabel.text = @"灰黑";
            break;
        default:
            break;
    }
    
}

-(UIView *)lienView{
    
    if (!_lienView) {
        _lienView = [[UIView alloc]init];
    }
    return _lienView;
}
-(UILabel *)nameLabel{
    
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.font = Bold(14);
        _nameLabel.textColor = RDRGB(0xAD7D62);
        _nameLabel.text = @"淡红";
    }
    return _nameLabel;
}
@end
